//
//  AudioPlayer.h
//  Session--Test
//
//  Created by lanou3g on 15/12/17.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
@class AudioPlayer;
@protocol AudioPlayerDelegate <NSObject>
//播放结束
- (void)playToTheEnd:(AudioPlayer *)player;
//播放到哪里了
- (void)playToWhere:(float)time player:(AudioPlayer *)player;
@end

@interface AudioPlayer : NSObject
/** 代理 */
@property (nonatomic, weak) id<AudioPlayerDelegate>delegate;
/** 是否正在播放(只读) */
@property (nonatomic, assign, readonly, getter=isPlaying) BOOL playing;
//单例
+ (instancetype)shareAudioPlayer;
//播放/暂停
- (void)palyOrPause;
//给url播放
- (void)playAudioWithUrl:(NSString *)url;
//设置音量
- (void)setVolume:(float)volume;
//从某一时刻开始播放
- (void)seekTimeToPlay:(float)time;
@end
